/*
 * cipher_stream.h
 *
 *  Created on: Apr 4, 2011
 *      Author: Erich Malzer
 */

#ifndef CIPHERSTREAM_H_
#define CIPHERSTREAM_H_

#include <string>

class CCipherStream {
public:
	/* Create CipherStream*/
	CCipherStream();

	virtual ~CCipherStream();

	/**
	 * Gets the next pCount bytes of the cipher stream and writes them onto the
	 * given string.
	 *
	 * @param pStream    The std::string where the cipher stream bytes are written on
	 * @param pCount     The length of the pStream string and therefore the amount of
	 *                   bytes of the cipher stream that should be returned
	 */
	virtual void getNext(std::string*, unsigned int pCount) = 0 ;

	/**
	 * Returns a fixed part of the cipher stream without taking into account the
	 * current position in the stream. With this method, any part of the stream can be
	 * read as often as desired.
	 *
	 * @param pStream    The std::string where the cipher stream bytes are written on
	 * @param pCount     The length of the pStream string and therefore the amount of
	 *                   bytes of the cipher stream that should be returned
	 * @param pOffset    The offset inside the cipher stream
	 */
	virtual bool getStaticKey(std::string*, unsigned int pCount, unsigned int pOffset) = 0;

	/**
	 * Resets the cipher stream with the given password. It basically does the same
	 * as creating a new object of this class.
	 *
	 * @param pPassword    The password
	 */
	virtual void reset(std::string *pStream) = 0;
};

#endif /* CIPHERSTREAM_H_ */
